function GetPlayerCoords(ped)
    return GetEntityCoords(ped)
end
RegisterNetEvent('deleteNPCC')
AddEventHandler('deleteNPCC', function(source)
    local playerIdx = GetPlayerFromServerId(source)
    local ped = GetPlayerPed(playerIdx)
    local playerCoords = GetEntityCoords(ped)
    local getrange= tonumber(args[1]) or 10 --获取范围或者范围为80
    local range=string.format("%0.1f",getrange)--范围必须为浮点型,所以进行数据类型转换,保留一位小数
    ClearAreaOfPeds(playerCoords.x, playerCoords.y, playerCoords.z, range, true)----删除范围内NPCPeds
    ClearAreaOfVehicles(playerCoords.x, playerCoords.y, playerCoords.z, range, false, false, false, false, false);----删除范围内Npccars
end)
-- 调用该函数，并使用 ClearAreaOfPeds 函数删除周围的 NPC